package com.xuecheng.content.feignclient.auth;

import com.xuecheng.auth.model.po.Company;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient(value="auth-api",path="/auth",contextId="company",
        fallbackFactory=CompanyClientFactory.class)
@RequestMapping("/company")
public interface CompanyClient {
    @GetMapping("/{id}")    //在feign的远程接口中，@PathVariable必须指定参数名
    public Company getById(@PathVariable("id") String id);
}
